<li>
    <a href="#" target="_blank">
    <img src="${refc.headUrl}"
             width="16" height="16">${refc.username}
    </a>
    <#if refc.type == 1>
    ：${refc.content}
    <#else>
    回复 ${refc.replyUsername} ：${refc.content}
    </#if>
    <a class="_j_reply re_reply" data-id="${refc._id}" data-uid="${refc.userId}"
       data-username="${refc.username}" title="添加回复" id="${refc._id}">回复</a>
    <br><span class="time">${refc.createTime?string('yyyy-MM-dd HH:mm:ss')}</span>
</li>
<div class="add-comment hide reply-form" data-area="${refc._id}" style="display: none;"
     data-show="false">
     <textarea class="comment_reply " autofocus data-comment_id="${refc._id}"
               data-ScenicId="${refc.scenicId}" style="overflow: hidden; color: rgb(204, 204, 204);"
               placeholder="回复${refc.username}:"></textarea>
     <a class="btn btn_submit_reply}" id="reply${refc._id}">回复</a>
</div>

<script>
    $('#reply${refc._id}').click(function () {
        var content = $('textarea[data-comment_id=${refc._id}]').val();
        if(!content){
            alert("评论不能为空!");
            return;
        }
        $.post('/scenic/refCommentAdd',{scenicId:'${refc.scenicId}',content:content,type:2,'refCommentId':'${refc.refCommentId}','replyUsername':'${refc.username}'},function (data) {
            $('#ul${refc.refCommentId}').append(data);
        })
        if(!$('.add-reply').hasClass("comment")){
            $('.add-reply').addClass("comment");
        }
        $('.add-comment').attr('style', 'display: none;')
        $('textarea[data-comment_id=${refc._id}]').val('');
        flag = false;
    })

    $('#${refc._id}').click(function () {
        if (!flag) {
            $('div[data-area=${refc._id}]').attr('style', 'display: block;')
            $('textarea[data-comment_id=${refc._id}]').focus()
            $('textarea[data-comment_id=${refc._id}]').addClass('focus')
            flag = true;
        } else if(flag) {
            $('.add-comment').attr('style', 'display: none;')
            flag = false;
        }
    })
</script>
